package com.ele.client.activity.editor;

import com.ele.client.activity.editor.widget.IsEditorWidget;
import com.ele.model.Question;
import com.ele.model.Section;
import com.ele.model.Word;
import com.google.gwt.user.client.TakesValue;
import com.google.gwt.user.client.ui.IsWidget;

import java.util.List;

public interface EditorView extends IsWidget {

    void setPresenter(Presenter presenter);

    void startLoading();

    void stopLoading();

    void setName(String name);

    void setDescription(String description);

    void clearQuestions();

    void clearWords();

    void addQuestionControl(IsEditorWidget<Question> widget);

    void addWordControl(IsEditorWidget<Word> widget);

    String getName();

    String getDescription();

    List<IsEditorWidget<Word>> getWordControls();

    List<IsEditorWidget<Question>> getQuestionControls();

    void removeWordControl(IsEditorWidget<Word> widget);

    void removeQuestionControl(IsEditorWidget<Question> widget);

    public interface Presenter extends TakesValue<Section> {
        void save();

        void load();

        void goToNext();

        void goToPrev();

        void addBlankQuestion();

        void addBlankWord();
    }
}
